package com.lagou.serialize;

import java.io.IOException;
/**
 * @ClassName: Serializer
 * @Description: 序列化接口
 * @Version: v1.0.0
 * @Author: chendong
 * @Date: 2021/1/9
 * Modification History:
 * Date             Author      Version     Description
 * -------------------------------------------------------------
 * 2021/1/9         chendong       v1.0.0         创建
 */

public interface Serializer {


    /**
     * java对象转换为二进制
     */
    byte[] serialize(Object object) throws IOException;

    /**
     * 二进制转换成java对象
     */
    <T> T deserialize(Class<T> clazz, byte[] bytes) throws IOException;
}
